
package org.come.Jpanel;

import com.tool.tcp.SpriteFactory;

import java.awt.event.*;
import java.awt.image.ImageObserver;

import com.updateNew.MyIsif;
import org.come.Frame.ZhuFrame;
import org.come.mouslisten.ChangeMouseSymbolMouslisten;
import org.come.mouslisten.WLLMouslisten;
import org.come.socket.Agreement;
import org.come.socket.SendMessageUntil;
import org.come.until.*;
import org.come.Frame.TestSetupJframe;

import java.awt.Graphics;
import java.io.File;
import java.util.*;

import org.come.entity.RoleSummoning;

import javax.swing.*;
import javax.swing.plaf.ScrollBarUI;

import org.come.mouslisten.MountMouslisten;

import org.come.Frame.MountJframe;
import com.tool.image.ImageMixDeal;
import org.come.entity.Mount;

import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import java.awt.Color;
import java.awt.Font;

import org.come.mouslisten.SystemMouslisten;

import java.awt.Component;

import com.tool.tcpimg.UIUtils;

import java.awt.Dimension;
import java.math.BigDecimal;

import com.tool.tcp.NewPart;

import com.tool.btn.MountPanelBtn;
import com.tool.btn.FormsOnOffBtn;

/**
 * 坐骑主面板
 *
 * @author Administrator
 */
public class mountJPanel extends JPanel {
    private JLabel labmountimg;// 放置坐骑图像
    private JLabel labmountlevel;// 坐骑等级
    private JLabel labmounttili;// 坐骑体力
    private JLabel labmountintelligence;// 坐骑灵性
    private JLabel labmountpower;// 坐骑力量
    private JLabel labmountRootbone;// 坐骑根骨
    private JLabel labmountexp;// 坐骑经验
    private JLabel hidden;
    public static int idx;
    public static int idx2;
    private FormsOnOffBtn offBtn;
    private JList<String> listmount;
    private static JList<String> listpet;
    private DefaultListModel<String> modelmount;
    private static DefaultListModel<String> listModel;
    private JScrollPane jScrollPane1;
    private JScrollPane jScrollPane2;
    private MountPanelBtn btnRiding;
    private MountPanelBtn btnControl;
    private MountPanelBtn btnFeeding;
    private MountPanelBtn btnKills;
    private MountPanelBtn btnRelease;
    private JLabel[] petlist = new JLabel[3];
    private int caozuio;
    public static int idxx;
    private Vector<Vector<String>> verVectors;
    private ImageIcon icon;
    private ImageIcon iconH; // 水墨UI背景图
    private ImageIcon iconH2; // 红木UI背景图
    private NewPart newPart;
    private BigDecimal se;
    private int mountid;
    public long time;
    private Map<Integer, RoleSummoning> p = new HashMap<>();
    private List<MountPanelBtn> shouhu = new ArrayList<>();

    public mountJPanel() throws Exception {
        this.caozuio = 0;
        this.time = 0L;
        this.setPreferredSize(new Dimension(740, 516));
        this.setLayout(null);
        this.setBackground(UIUtils.Color_BACK);
        this.trisd();
    }

    public void trisd() {
        for (int i = 0; i < 3; i++) {
            (petlist[i] = new JLabel()).setBounds(600, 80 + i * 68, 45, 45);
            petlist[i].addMouseListener(new MouseAdapter() {
                @Override
                public void mouseClicked(MouseEvent e) {
                    super.mouseClicked(e);
                    if (e.getButton() == 3) {
                        JLabel label = (JLabel) e.getSource();
                        int c = 35;
                        String style = MyIsif.getStyle();
                        if ("水墨UI".equals(style)) {
                            if (mountJPanel.this.listmount.getSelectedIndex() >= 0) {
                                final Mount mount = (Mount) ZhuJpanel.getListMount().get(mountJPanel.this.listmount.getSelectedIndex());
                                if (mount != null && mount.getMountlvl() > 100)
                                    c = 64;
                                else if (mount != null && mount.getMountlvl() <= 100) {
                                    c = 97;
                                }
                            }
                        } else {
                            if (mountJPanel.this.listmount.getSelectedIndex() >= 0) {
                                final Mount mount = (Mount) ZhuJpanel.getListMount().get(mountJPanel.this.listmount.getSelectedIndex());
                                if (mount != null && mount.getMountlvl() > 100)
                                    c = 64;
                                else if (mount != null && mount.getMountlvl() <= 100) {
                                    c = 97;
                                }
                            }
                        }
                        int k = 3;
                        if (label.getY() == c) k = 0;
                        else if (label.getY() == c + 68) k = 1;
                        else if (label.getY() == 200) k = 2;
                        if (p.size() != 0 && k != 3) {
                            RoleSummoning pet = p.get(k);
                            if (pet == null) return;
                            Mount mount = (Mount) ZhuJpanel.getListMount().get(mountJPanel.this.listmount.getSelectedIndex());
                            if (mount != null) {
                                int type = 0;
                                if (mount.getSid() != null && pet.getSid().compareTo(mount.getSid()) == 0) {
                                    type = -1;
                                    mount.setSid(null);
                                    // petlist[0].setText(null);
                                    p.remove(0);
                                    petlist[0].setIcon(null);
                                } else if (mount.getOthrersid() != null && pet.getSid().compareTo(mount.getOthrersid()) == 0) {
                                    type = -2;
                                    mount.setOthrersid(null);
                                    p.remove(1);
                                    petlist[1].setIcon(null);
                                } else if (mount.getSid3() != null && pet.getSid().compareTo(mount.getSid3()) == 0) {
                                    type = -3;
                                    mount.setSid3(null);
                                    p.remove(2);
                                    petlist[2].setIcon(null);
                                }
                                if (type < 0) {
                                    ChangeMouseSymbolMouslisten.clearPropertie(pet);
                                }
                                final String sendmes = Agreement.getAgreement().changeMountValue(GsonUtil.getGsonUtil().getgson().toJson(mount));
                                SendMessageUntil.toServer(sendmes);
                            }
                        }
                    }
                }

                @Override
                public void mouseEntered(MouseEvent e) {
                    super.mouseEntered(e);
                    JLabel label = (JLabel) e.getSource();
                    int c = 35;
                    String style = MyIsif.getStyle();
                    if ("水墨UI".equals(style)) {
                        if (mountJPanel.this.listmount.getSelectedIndex() >= 0) {
                            final Mount mount = (Mount) ZhuJpanel.getListMount().get(mountJPanel.this.listmount.getSelectedIndex());
                            if (mount != null && mount.getMountlvl() > 100)
                                c = 64;
                            else if (mount != null && mount.getMountlvl() <= 100) {
                                c = 97;
                            }
                        }
                    } else {
                        if (mountJPanel.this.listmount.getSelectedIndex() >= 0) {
                            final Mount mount = (Mount) ZhuJpanel.getListMount().get(mountJPanel.this.listmount.getSelectedIndex());
                            if (mount != null && mount.getMountlvl() > 100)
                                c = 64;
                            else if (mount != null && mount.getMountlvl() <= 100) {
                                c = 97;
                            }
                        }
                    }
                    int k = 3;
                    if (label.getY() == c) k = 0;
                    else if (label.getY() == c + 68) k = 1;
                    else if (label.getY() == 200) k = 2;
                    if (k != 3 && p.get(k) != null) {
                        ZhuFrame.getZhuJpanel().creatpettext(p.get(k));
                    }

                }

                @Override
                public void mouseExited(MouseEvent e) {
                    super.mouseExited(e);
                    FormsManagement.HideForm(42);
                }
            });
            petlist[i].setOpaque(false);
            petlist[i].setBackground(Color.white);
            add(petlist[i]);
        }
        String style = MyIsif.getStyle();
        if ("水墨UI".equals(style)) {
            (this.offBtn = new FormsOnOffBtn("inkImg/button/1.png", 1, 7)).setBounds(367, 3, 17, 17);
            this.add((Component) this.offBtn);
            (this.labmountimg = new JLabel()).setBounds(25, 43, 125, 185);
            this.add((Component) this.labmountimg);
            (this.hidden = new JLabel()).addMouseListener(new SystemMouslisten(23));
            this.add((Component) this.hidden);
            final Font font = new Font("微软雅黑", 1, 12);
            (this.labmountlevel = new JLabel()).setBounds(220, 40, 99, 17);
            this.labmountlevel.setForeground(Color.WHITE);
            this.labmountlevel.setFont(font);
            this.add((Component) this.labmountlevel);
            (this.labmounttili = new JLabel()).setBounds(220, 78, 99, 17);
            this.labmounttili.setForeground(Color.WHITE);
            this.labmounttili.setFont(font);
            this.add((Component) this.labmounttili);
            (this.labmountintelligence = new JLabel()).setBounds(220, 113, 99, 17);
            this.labmountintelligence.setForeground(Color.WHITE);
            this.labmountintelligence.setFont(font);
            this.add((Component) this.labmountintelligence);
            (this.labmountpower = new JLabel()).setBounds(220, 148, 99, 17);
            this.labmountpower.setForeground(Color.WHITE);
            this.labmountpower.setFont(font);
            this.add((Component) this.labmountpower);
            (this.labmountRootbone = new JLabel()).setBounds(220, 183, 99, 17);
            this.labmountRootbone.setForeground(Color.WHITE);
            this.labmountRootbone.setFont(font);
            this.add((Component) this.labmountRootbone);
            (this.labmountexp = new JLabel()).setBounds(220, 217, 99, 17);
            this.labmountexp.setForeground(Color.WHITE);
            this.labmountexp.setFont(font);
            this.add((Component) this.labmountexp);
        } else {
            this.offBtn = new FormsOnOffBtn("inkImg/hongmu/s74.png", 1, 7);
            offBtn.setBounds(711, 2, 25, 25);
            this.add(this.offBtn);
            (this.labmountimg = new JLabel()).setBounds(25, 43, 125, 185);
            this.add(this.labmountimg);
            (this.hidden = new JLabel()).addMouseListener(new SystemMouslisten(23));
            this.add(this.hidden);
            final Font font = new Font("微软雅黑", 1, 12);
            (this.labmountlevel = new JLabel()).setBounds(72, 296, 99, 18);
            this.labmountlevel.setForeground(Color.WHITE);
            this.labmountlevel.setFont(font);
            this.add(this.labmountlevel);
            (this.labmounttili = new JLabel()).setBounds(72, 326, 99, 18);
            this.labmounttili.setForeground(Color.WHITE);
            this.labmounttili.setFont(font);
            this.add(this.labmounttili);
            (this.labmountintelligence = new JLabel()).setBounds(72, 354, 99, 18);
            this.labmountintelligence.setForeground(Color.WHITE);
            this.labmountintelligence.setFont(font);
            this.add(this.labmountintelligence);
            (this.labmountpower = new JLabel()).setBounds(72, 382, 99, 18);
            this.labmountpower.setForeground(Color.WHITE);
            this.labmountpower.setFont(font);
            this.add(this.labmountpower);
            (this.labmountRootbone = new JLabel()).setBounds(72, 410, 99, 18);
            this.labmountRootbone.setForeground(Color.WHITE);
            this.labmountRootbone.setFont(font);
            this.add(this.labmountRootbone);
            (this.labmountexp = new JLabel()).setBounds(72, 440, 99, 18);
            this.labmountexp.setForeground(Color.WHITE);
            this.labmountexp.setFont(font);
            this.add(this.labmountexp);
        }
        mountJPanel.listModel = new DefaultListModel();
        mountJPanel.listpet = new JList<String>(mountJPanel.listModel) {
            {
                this.setOpaque(false);
            }
        };
        this.modelmount = new DefaultListModel();
        (this.listmount = new JList<String>() {
            {
                this.setOpaque(false);
            }
        }).setSelectionBackground(new Color(33, 42, 52));
        this.listmount.setSelectionForeground(Color.GREEN);
        this.listmount.setForeground(Color.GREEN);
        this.listmount.setFont(new Font("微软雅黑", 1, 14));
        this.listmount.setBackground(UIUtils.Color_BACK);
        this.listmount.setModel(this.modelmount);
        this.listmount.setCellRenderer(new MyRendererXIAO());
        this.listmount.addMouseListener(new MouseAdapter() {
            @Override
            public void mousePressed(final MouseEvent e) {
                //   FormsManagement.showForm(289);
                super.mousePressed(e);
            }
        });
        this.listmount.addListSelectionListener(new ListSelectionListener() {
            @Override
            public void valueChanged(final ListSelectionEvent e) {
                try {
                    String style = MyIsif.getStyle();
                    if (mountJPanel.this.listmount.getSelectedIndex() >= 0) {
                        final Mount mount = "水墨UI".equals(style) ?
                                (Mount) ZhuJpanel.getListMount().get(mountJPanel.this.listmount.getSelectedIndex()) :
                                ZhuJpanel.getListMount().get(mountJPanel.this.listmount.getSelectedIndex());

                        ExpIncreaseUntil.showMountValue(mount);

                        if ("水墨UI".equals(style)) {
                            if (mount.getMountlvl() > 100) {
                                iconH = new ImageIcon("inkImg/Client/坐骑背景_飞升后.png");
                                for (int i = 0; i <= petlist.length - 1; i++) {
                                    mountJPanel.this.petlist[i].setBounds(643, 64 + i * 68, 45, 45);//管制坐骑头像位置
                                }
                            } else {
                                for (int i = 0; i <= petlist.length - 1; i++) {
                                    mountJPanel.this.petlist[i].setBounds(643, 97 + i * 68, 45, 45);
                                }
                                iconH = new ImageIcon("inkImg/Client/坐骑背景_飞升前.png");
                            }

                            if (false) {//GameClientcaonimab.getClassic() == 1
                                if (mount.getMountid() == ImageMixDeal.userimg.getRoleShow().getMount_id()) {
                                    MountJframe.getMountjframe().getMountjpanel().getBtnRiding().setIcons(CutButtonImage.cuts("inkimg/hongmu/ss695.png"));
                                } else {
                                    MountJframe.getMountjframe().getMountjpanel().getBtnRiding().setIcons(CutButtonImage.cuts("inkimg/hongmu/ss694.png"));
                                }
                            } else {
                                if (mount.getMountid() == ImageMixDeal.userimg.getRoleShow().getMount_id()) {
                                    mountJPanel.this.btnRiding.setText("休息");
                                } else {
                                    mountJPanel.this.btnRiding.setText("骑乘");
                                }
                            }

                            // 处理宠物图标
                            handlePetIcons(mount, "img/newHead/p", style);
                        } else {
                            // 红木UI风格
                            if (mount.getMountlvl() > 100) {
                                iconH2 = new ImageIcon("inkImg/hongmu/坐骑背景红木飞.png");
                                for (int i = 0; i <= petlist.length - 1; i++) {
                                    mountJPanel.this.petlist[i].setBounds(639, 64 + i * 68, 45, 45);//管制坐骑头像位置
                                }
                            } else {
                                for (int i = 0; i <= petlist.length - 1; i++) {
                                    mountJPanel.this.petlist[i].setBounds(639, 97 + i * 68, 45, 45);
                                }
                                iconH2 = new ImageIcon("inkImg/hongmu/坐骑背景红木未.png");
                            }

                            if (false) {//GameClientcaonimab.getClassic() == 1
                                if (mount.getMountid() == ImageMixDeal.userimg.getRoleShow().getMount_id()) {
                                    MountJframe.getMountjframe().getMountjpanel().getBtnRiding().setIcons(CutButtonImage.cuts("inkimg/hongmu/1/ss695.png"));
                                } else {
                                    MountJframe.getMountjframe().getMountjpanel().getBtnRiding().setIcons(CutButtonImage.cuts("inkimg/hongmu/1/ss694.png"));
                                }
                            } else {
                                if (mount.getMountid() == ImageMixDeal.userimg.getRoleShow().getMount_id()) {
                                    mountJPanel.this.btnRiding.setText("休息");
                                } else {
                                    mountJPanel.this.btnRiding.setText("骑乘");
                                }
                            }

                            // 处理宠物图标
                            handlePetIcons(mount, "img/head/p", style);
                        }
                    }
                } catch (Exception e2) {
                    e2.printStackTrace();
                }
            }

            // 统一处理宠物图标的方法
            private void handlePetIcons(Mount mount, String imagePathPrefix, String style) {
                // 处理第一个宠物
                if (mount.getSid() != null) {
                    RoleSummoning roleSummoning = UserMessUntil.getPetRgid(mount.getSid());
                    if (roleSummoning == null) return;
                    final String path = imagePathPrefix + roleSummoning.getSummoningskin() + ".png";
                    final File file = new File(path);
                    if (file.exists()) {
                        final ImageIcon icon2 = CutButtonImage.size(path, 45, 45);
                        petlist[0].setIcon("水墨UI".equals(style) ? (Icon) icon2 : icon2);
                        p.put(0, roleSummoning);
                    } else {
                        final ImageIcon icon2 = CutButtonImage.getImage("img/xy2uiimg/101_png.xy2uiimg.pet_def.png", -1, -1);
                        petlist[0].setIcon("水墨UI".equals(style) ? (Icon) icon2 : icon2);
                        p.put(0, roleSummoning);
                    }
                } else {
                    petlist[0].setIcon(null);
                    p.remove(0);
                }

                // 处理第二个宠物
                if (mount.getOthrersid() != null) {
                    RoleSummoning roleSummoning = UserMessUntil.getPetRgid(mount.getOthrersid());
                    if (roleSummoning == null) return;
                    final String path = imagePathPrefix + roleSummoning.getSummoningskin() + ".png";
                    final File file = new File(path);
                    if (file.exists()) {
                        final ImageIcon icon2 = CutButtonImage.size(path, 45, 45);
                        petlist[1].setIcon("水墨UI".equals(style) ? (Icon) icon2 : icon2);
                        p.put(1, roleSummoning);
                    } else {
                        final ImageIcon icon2 = CutButtonImage.getImage("img/xy2uiimg/101_png.xy2uiimg.pet_def.png", -1, -1);
                        petlist[1].setIcon("水墨UI".equals(style) ? (Icon) icon2 : icon2);
                        p.put(1, roleSummoning);
                    }
                } else {
                    petlist[1].setIcon(null);
                    p.remove(1);
                }

                // 处理第三个宠物
                if (mount.getSid3() != null) {
                    RoleSummoning roleSummoning = UserMessUntil.getPetRgid(mount.getSid3());
                    if (roleSummoning == null) return;
                    final String path = imagePathPrefix + roleSummoning.getSummoningskin() + ".png";
                    final File file = new File(path);
                    if (file.exists()) {
                        final ImageIcon icon2 = CutButtonImage.size(path, 45, 45);
                        petlist[2].setIcon("水墨UI".equals(style) ? (Icon) icon2 : icon2);
                        p.put(2, roleSummoning);
                    } else {
                        final ImageIcon icon2 = CutButtonImage.getImage("img/xy2uiimg/101_png.xy2uiimg.pet_def.png", -1, -1);
                        petlist[2].setIcon("水墨UI".equals(style) ? (Icon) icon2 : icon2);
                        p.put(2, roleSummoning);
                    }
                } else {
                    petlist[2].setIcon(null);
                    p.remove(2);
                }
            }
        });

        if ("水墨UI".equals(style)) {
            (this.jScrollPane1 = new JScrollPane((Component) this.listmount)).setVerticalScrollBarPolicy(22);
            this.jScrollPane1.getVerticalScrollBar().setUI(null);
            this.jScrollPane1.getViewport().setOpaque(false);
            this.jScrollPane1.setOpaque(false);
            this.jScrollPane1.setBounds(27, 277, 132, 155);
            this.jScrollPane1.setBorder(BorderFactory.createEmptyBorder());
            this.jScrollPane1.setHorizontalScrollBarPolicy(31);
            this.add((Component) this.jScrollPane1);
            this.verVectors = new Vector();
            final Vector<String> verStrings = new Vector();
            verStrings.add("");
            verStrings.add("");
            mountJPanel.listpet.setCellRenderer(new MyRendererxL());
            mountJPanel.listpet.setSelectionBackground(new Color(33, 42, 52));
            mountJPanel.listpet.setSelectionMode(0);
            mountJPanel.listpet.addMouseListener(new MountMouslisten(mountJPanel.listpet, this));
            mountJPanel.listpet.addMouseMotionListener(new MountMouslisten(mountJPanel.listpet, this));
            (this.jScrollPane2 = new JScrollPane((Component) mountJPanel.listpet)).setVerticalScrollBarPolicy(22);
            this.jScrollPane2.getVerticalScrollBar().setUI(new SrcollPanelUI());
            this.jScrollPane2.getViewport().setOpaque(false);
            this.jScrollPane2.setOpaque(false);
            this.jScrollPane2.setBounds(173, 277, 194, 155);
            this.jScrollPane2.setBorder(BorderFactory.createEmptyBorder());
            this.jScrollPane2.setHorizontalScrollBarPolicy(31);
            this.add((Component) this.jScrollPane2);
            (this.btnRiding = new MountPanelBtn("", 1, "骑乘", this, 1)).setBounds(32, 448, 64, 24);
            this.add((Component) this.btnRiding);
            (this.btnControl = new MountPanelBtn("", 1, "管制", this, 3)).setBounds(98, 448, 64, 24);
            // this.add((Component)this.btnControl);
            (this.btnFeeding = new MountPanelBtn("", 1, "喂养", this, 4)).setBounds(164, 448, 64, 24);
            this.add((Component) this.btnFeeding);
            (this.btnKills = new MountPanelBtn("", 1, "技能", this, 5)).setBounds(230, 448, 64, 24);
            this.add((Component) this.btnKills);
            (this.btnRelease = new MountPanelBtn("inkImg/background/1/nex.png", 1, "", this, 6)).setBounds(200 + 28, 248 + 19, 29, 23);//放生坐骑
            this.add((Component) this.btnRelease);
            MountPanelBtn btn = new MountPanelBtn("inkImg/Client/未选中按钮.png", 1, "坐骑", this, 7, UIUtils.Black);
            btn.setBounds(50, 15, 100, 33);
            add(btn);
            shouhu.add(btn);
            MountPanelBtn btn1 = new MountPanelBtn("inkImg/Client/未选中按钮.png", 1, "守护", this, 8, UIUtils.Black);
            btn1.setBounds(160, 15, 100, 33);
            add(btn1);
            shouhu.add(btn1);
        } else {
            (this.jScrollPane1 = new JScrollPane(this.listmount)).setVerticalScrollBarPolicy(22);
            this.jScrollPane1.getVerticalScrollBar().setUI(null);
            this.jScrollPane1.getViewport().setOpaque(false);
            this.jScrollPane1.setOpaque(false);
            this.jScrollPane1.setBounds(33, 80, 200, 200);
            this.jScrollPane1.setBorder(BorderFactory.createEmptyBorder());
            this.jScrollPane1.setHorizontalScrollBarPolicy(31);
            this.add(this.jScrollPane1);
            this.verVectors = new Vector();
            final Vector<String> verStrings = new Vector();
            verStrings.add("");
            verStrings.add("");
            mountJPanel.listpet.setCellRenderer(new MyRendererxL());
            mountJPanel.listpet.setSelectionBackground(new Color(33, 42, 52));
            mountJPanel.listpet.setSelectionMode(0);
            mountJPanel.listpet.addMouseListener(new MountMouslisten(mountJPanel.listpet, this));
            mountJPanel.listpet.addMouseMotionListener(new MountMouslisten(mountJPanel.listpet, this));
            (this.jScrollPane2 = new JScrollPane(mountJPanel.listpet)).setVerticalScrollBarPolicy(22);
            this.jScrollPane2.getVerticalScrollBar().setUI(new SrcollPanelUI());
            this.jScrollPane2.getViewport().setOpaque(false);
            this.jScrollPane2.setOpaque(false);
            this.jScrollPane2.setBounds(273, 300, 425, 175);
            this.jScrollPane2.setBorder(BorderFactory.createEmptyBorder());
            this.jScrollPane2.setHorizontalScrollBarPolicy(31);
            this.add(this.jScrollPane2);
            (this.btnRiding = new MountPanelBtn("inkImg/hongmu/60X26按钮(1).png", 1, "骑乘", this, 1)).setBounds(30, 465, 60, 26);
            this.add(this.btnRiding);
            (this.btnControl = new MountPanelBtn("inkImg/hongmu/60X26按钮(1).png", 1, "管制", this, 3)).setBounds(510, 150, 64, 24);
            //this.add((Component)this.btnControl);
            (this.btnFeeding = new MountPanelBtn("inkImg/hongmu/60X26按钮(1).png", 1, "喂养", this, 4)).setBounds(185, 465, 60, 26);
            this.add(this.btnFeeding);
            (this.btnKills = new MountPanelBtn("inkImg/hongmu/60X26按钮(1).png", 1, "技能", this, 5)).setBounds(108, 465, 60, 26);
            this.add(this.btnKills);
            (this.btnRelease = new MountPanelBtn("inkImg/hongmu/nex(1).png", 1, "", this, 6)).setBounds(200 , 248 + 9, 29, 23);//放生坐骑
            this.add(this.btnRelease);
            MountPanelBtn btn = new MountPanelBtn("inkImg/hongmu/未选中按钮(1).png", 1, "坐骑", this, 7, UIUtils.White);
            btn.setBounds(40, 25, 100, 33);
            add(btn);
            shouhu.add(btn);
            MountPanelBtn btn1 = new MountPanelBtn("inkImg/hongmu/未选中按钮(1).png", 1, "守护", this, 8, UIUtils.White);
            btn1.setBounds(140, 25, 100, 33);
            add(btn1);
            shouhu.add(btn1);

        }

        // 根据UI风格设置组件位置
        if ("水墨UI".equals(style)) {
            labmountlevel.setBounds(92, 300, 99, 18);
            labmounttili.setBounds(92, 330, 99, 18);
            labmountintelligence.setBounds(92, 360, 99, 18);
            labmountpower.setBounds(92, 390, 99, 18);
            labmountRootbone.setBounds(92, 420, 99, 18);
            labmountexp.setBounds(92, 450, 99, 18);
            jScrollPane1.setBounds(50, 74, 200, 200);
            jScrollPane2.setBounds(280, 300, 425, 200);
            hidden.setBounds(570, 25, 15, 15);
            offBtn.setBounds(703, 15, 17, 17);
        } else {
            labmountlevel.setBounds(72, 296, 99, 18);
            labmounttili.setBounds(72, 326, 99, 18);
            labmountintelligence.setBounds(72, 354, 99, 18);
            labmountpower.setBounds(72, 382, 99, 18);
            labmountRootbone.setBounds(72, 410, 99, 18);
            labmountexp.setBounds(72, 440, 99, 18);
            jScrollPane1.setBounds(33, 80, 200, 200);
            jScrollPane2.setBounds(273, 300, 425, 175);
            hidden.setBounds(711, 2, 25, 25);
            offBtn.setBounds(711, 2, 25, 25);
        }

        try {
            if ("水墨UI".equals(style)) {
                btnRiding.setIcons(CutButtonImage.cuts("inkImg/Client/60X26按钮.png"));
                btnRiding.setBounds(45, 475, 60, 26);
                btnFeeding.setIcons(CutButtonImage.cuts("inkImg/Client/60X26按钮.png"));
                btnFeeding.setBounds(200, 475, 60, 26);
                btnKills.setIcons(CutButtonImage.cuts("inkImg/Client/60X26按钮.png"));
                btnKills.setBounds(123, 475, 60, 26);
            } else {
                btnRiding.setIcons(CutButtonImage.cuts("inkImg/hongmu/60X26按钮(1).png"));
                btnRiding.setBounds(30, 465, 60, 26);
                btnFeeding.setIcons(CutButtonImage.cuts("inkImg/hongmu/60X26按钮(1).png"));
                btnFeeding.setBounds(185, 465, 60, 26);
                btnKills.setIcons(CutButtonImage.cuts("inkImg/hongmu/60X26按钮(1).png"));
                btnKills.setBounds(108, 465, 60, 26);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }

    }

    public static void showListModel(final List<RoleSummoning> pets, final BigDecimal petid) {
        mountJPanel.listModel.removeAllElements();
        final Iterator<RoleSummoning> iterator = pets.iterator();
        while (iterator.hasNext()) {
            final RoleSummoning pet = (RoleSummoning) iterator.next();
            mountJPanel.listModel.addElement(pet.getSummoningname());
        }
    }

    @Override
    protected void paintComponent(final Graphics g) {
        String style = MyIsif.getStyle();
        if ("水墨UI".equals(style)) {
            super.paintComponent(g);
            this.time += 24L;
            // 初始化水墨UI背景图
            if (this.iconH == null) {
                this.iconH = new ImageIcon("inkImg/Client/坐骑背景.png");
            }
            g.drawImage(this.iconH.getImage(), 0, 0, 740, 516, (ImageObserver) this);
            drawMountSprite(g);
        } else {
            super.paintComponent(g);
            this.time += 24L;
            // 初始化红木UI背景图
            if (this.iconH2 == null) {
                this.iconH2 = new ImageIcon("inkImg/hongmu/坐骑背景.png");
            }
            g.drawImage(this.iconH2.getImage(), 0, 0, 740, 516, this);
            drawMountSprite(g);
        }
    }

    // 统一绘制坐骑精灵的方法
    private void drawMountSprite(Graphics g) {
        if (this.listmount.getSelectedIndex() != -1) {
            final int index = this.listmount.getSelectedIndex();
            if (ZhuJpanel.getListMount().size() > index) {
                final Mount mount = "水墨UI".equals(MyIsif.getStyle()) ?
                        (Mount) ZhuJpanel.getListMount().get(index) :
                        ZhuJpanel.getListMount().get(index);

                if (newPart == null) {
                    mountid = mount.getMountid();
                    se = ImageMixDeal.userimg.getRoleShow().getSpecies_id();
                    newPart = SpriteFactory.createPart((long) mountid << 40 | se.longValue(), 2, 1, null);
                } else {
                    if (mountid != mount.getMountid() || se.compareTo(ImageMixDeal.userimg.getRoleShow().getSpecies_id()) != 0) {
                        mountid = mount.getMountid();
                        se = ImageMixDeal.userimg.getRoleShow().getSpecies_id();
                        newPart = SpriteFactory.createPart((long) mountid << 40 | se.longValue(), 2, 1, null);
                    }
                }
                newPart.draw(g, 380, 220, 0, ImageMixDeal.userimg.getTime());
            }
        }
    }

    public JLabel getLabmountimg() {
        return this.labmountimg;
    }

    public void setLabmountimg(final JLabel labmountimg) {
        this.labmountimg = labmountimg;
    }

    public JLabel getLabmountlevel() {
        return this.labmountlevel;
    }

    public void setLabmountlevel(final JLabel labmountlevel) {
        this.labmountlevel = labmountlevel;
    }

    public JLabel getLabmounttili() {
        return this.labmounttili;
    }

    public void setLabmounttili(final JLabel labmounttili) {
        this.labmounttili = labmounttili;
    }

    public JLabel getLabmountintelligence() {
        return this.labmountintelligence;
    }

    public void setLabmountintelligence(final JLabel labmountintelligence) {
        this.labmountintelligence = labmountintelligence;
    }

    public JLabel getLabmountpower() {
        return this.labmountpower;
    }

    public void setLabmountpower(final JLabel labmountpower) {
        this.labmountpower = labmountpower;
    }

    public JLabel getLabmountRootbone() {
        return this.labmountRootbone;
    }

    public void setLabmountRootbone(final JLabel labmountRootbone) {
        this.labmountRootbone = labmountRootbone;
    }

    public JLabel getLabmountexp() {
        return this.labmountexp;
    }

    public void setLabmountexp(final JLabel labmountexp) {
        this.labmountexp = labmountexp;
    }

    public JList<String> getListmount() {
        return this.listmount;
    }

    public void setListmount(final JList<String> listmount) {
        this.listmount = listmount;
    }

    public DefaultListModel<String> getModelmount() {
        return this.modelmount;
    }

    public void setModelmount(final DefaultListModel<String> modelmount) {
        this.modelmount = modelmount;
    }

    public JScrollPane getjScrollPane1() {
        return this.jScrollPane1;
    }

    public void setjScrollPane1(final JScrollPane jScrollPane1) {
        this.jScrollPane1 = jScrollPane1;
    }

    public JScrollPane getjScrollPane2() {
        return this.jScrollPane2;
    }

    public void setjScrollPane2(final JScrollPane jScrollPane2) {
        this.jScrollPane2 = jScrollPane2;
    }

    public MountPanelBtn getBtnRiding() {
        return this.btnRiding;
    }

    public void setBtnRiding(final MountPanelBtn btnRiding) {
        this.btnRiding = btnRiding;
    }

    public MountPanelBtn getBtnControl() {
        return this.btnControl;
    }

    public void setBtnControl(final MountPanelBtn btnControl) {
        this.btnControl = btnControl;
    }

    public MountPanelBtn getBtnFeeding() {
        return this.btnFeeding;
    }

    public void setBtnFeeding(final MountPanelBtn btnFeeding) {
        this.btnFeeding = btnFeeding;
    }

    public MountPanelBtn getBtnKills() {
        return this.btnKills;
    }

    public void setBtnKills(final MountPanelBtn btnKills) {
        this.btnKills = btnKills;
    }

    public static JList<String> getListpet() {
        return mountJPanel.listpet;
    }

    public static void setListpet(final JList<String> listpet) {
        mountJPanel.listpet = listpet;
    }

    public static int getIdx() {
        return mountJPanel.idx;
    }

    public static void setIdx(final int idx) {
        mountJPanel.idx = idx;
    }

    public static DefaultListModel<String> getListModel() {
        return mountJPanel.listModel;
    }

    public static void setListModel(final DefaultListModel<String> listModel) {
        mountJPanel.listModel = listModel;
    }

    public MountPanelBtn getBtnRelease() {
        return this.btnRelease;
    }

    public void setBtnRelease(final MountPanelBtn btnRelease) {
        this.btnRelease = btnRelease;
    }

    public static int getIdxx() {
        return mountJPanel.idxx;
    }

    public static void setIdxx(final int idxx) {
        mountJPanel.idxx = idxx;
    }

    public ImageIcon getIcon() {
        return this.icon;
    }

    public void setIcon(final ImageIcon icon) {
        this.icon = icon;
    }

    public NewPart getNewPart() {
        return this.newPart;
    }

    public void setNewPart(final NewPart newPart) {
        this.newPart = newPart;
    }

    public BigDecimal getSe() {
        return this.se;
    }

    public void setSe(final BigDecimal se) {
        this.se = se;
    }

    public int getMountid() {
        return this.mountid;
    }

    public void setMountid(final int mountid) {
        this.mountid = mountid;
    }

    public Vector<Vector<String>> getVerVectors() {
        return this.verVectors;
    }

    public void setVerVectors(final Vector<Vector<String>> verVectors) {
        this.verVectors = verVectors;
    }

    public FormsOnOffBtn getOffBtn() {
        return this.offBtn;
    }

    public void setOffBtn(final FormsOnOffBtn offBtn) {
        this.offBtn = offBtn;
    }

    public JLabel getHidden() {
        return this.hidden;
    }

    public int getCaozuio() {
        return this.caozuio;
    }

    public void setCaozuio(final int caozuio) {
        this.caozuio = caozuio;
    }

    public JLabel[] getPetlist() {
        return petlist;
    }

    public void setPetlist(JLabel[] petlist) {
        this.petlist = petlist;
    }

    public Map<Integer, RoleSummoning> getP() {
        return p;
    }

    public void setP(Map<Integer, RoleSummoning> p) {
        this.p = p;
    }

    public List<MountPanelBtn> getShouhu() {
        return shouhu;
    }

    public void setShouhu(List<MountPanelBtn> shouhu) {
        this.shouhu = shouhu;
    }

    static {
        idx = -1;
        idx2 = -1;
        idxx = -1;
    }
}